package com.qf.ex;

import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.ex
 * @Description:
 * @Date 2022/10/11 15:25
 */
@ControllerAdvice
public class MyHanderException {


    @ExceptionHandler({
            AuthorizationException.class
    })
    public ModelAndView handlerAuthorizationException(AuthorizationException e){
        e.printStackTrace();
        ModelAndView mav = new ModelAndView();
        mav.setViewName("redirect:/login.html");
        return mav;
    }
}
